package com.by.facade.enums.refundOrder;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
 * @author Tian Wei
 * @version 1.0
 * @date 2025/2/28 11:25
 */

@Getter
@AllArgsConstructor
public enum RefundOrderFeedbackStatusEnum {

    WAIT_FEEDBACK(1,"待回访"),
    COMPLETE_FEEDBACK(2,"回访完成")

    ;
    private Integer status;

    private String desc;

    private static final Map<Integer,RefundOrderFeedbackStatusEnum> MAP ;
    static {
        MAP = Stream.of(RefundOrderFeedbackStatusEnum.values()).collect(Collectors.toMap(RefundOrderFeedbackStatusEnum::getStatus, Function.identity()));
    }

    public static RefundOrderFeedbackStatusEnum resolveByStatus(Integer status){
        return MAP.get(status);
    }

}
